﻿@using NewLife.CMX;
@{
    var cat = ViewBag.Category as ICategory;
    var mod = cat != null ? cat.Model : null;
}
@if (mod != null && cat != null)
{
    <i class="ace-icon fa fa-home home-icon"></i>
    <a href="@Url.Action("Index", new { model = mod.ID, category = cat.ID })" class="h4"><strong>@mod.Name</strong></a>
    if (cat != null)
    {
        foreach (ICategory item in cat.AllParents)
        {
            if (item.ID != 0)
            {
                <text>&nbsp;/&nbsp;</text>
                <a href="@Url.Action("Index", new { model = mod.ID, category = item.ID })" class="h4">@item.Name</a>
            }
        }
    }
    <text>&nbsp;/&nbsp;</text>
    <a href="@Url.Action("Index", new { model = mod.ID, category = cat.ID })" class="h4"><strong>@cat.Name</strong></a>
}
else
{
    var menu = ManageProvider.Menu.Current;
    <i class="ace-icon fa fa-home home-icon"></i>
    if (menu != null)
    {
        foreach (IMenu item in menu.AllParents)
        {
            if (item.ID != 0)
            {
                <a href="@(item.Url!=null? Url.Content(item.Url):"#")" class="h4">@item.DisplayName</a>
                <text>&nbsp;/&nbsp;</text>
            }
        }
    }
    <a href="@Url.Action("Index")" class="h4"><strong>@(menu != null ? menu.DisplayName : ViewBag.Title)</strong></a>}